home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / addflo / data1.cab / Program_Executable_Files / AddFlow / Samples / Demo / Network.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-05-06  |  11.3 KB  |  330 lines

  1. VERSION 4.00
  2. Begin VB.Form frmNetwork 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "Example 2: NetWork"
  6.    ClientHeight    =   3480
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1785
  9.    ClientWidth     =   5325
  10.    BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  11.       Name            =   "MS Sans Serif"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   700
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   3885
  21.    Left            =   1035
  22.    LinkTopic       =   "Form2"
  23.    MDIChild        =   -1  'True
  24.    ScaleHeight     =   3480
  25.    ScaleWidth      =   5325
  26.    Tag             =   "2"
  27.    Top             =   1440
  28.    Width           =   5445
  29.    Begin VB.PictureBox Picture1 
  30.       Appearance      =   0  'Flat
  31.       BackColor       =   &H80000005&
  32.       ForeColor       =   &H80000008&
  33.       Height          =   525
  34.       Index           =   0
  35.       Left            =   4650
  36.       ScaleHeight     =   495
  37.       ScaleWidth      =   555
  38.       TabIndex        =   3
  39.       Top             =   120
  40.       Visible         =   0   'False
  41.       Width           =   585
  42.    End
  43.    Begin VB.PictureBox Picture1 
  44.       Appearance      =   0  'Flat
  45.       BackColor       =   &H80000005&
  46.       ForeColor       =   &H80000008&
  47.       Height          =   525
  48.       Index           =   3
  49.       Left            =   4650
  50.       Picture         =   "Network.frx":0000
  51.       ScaleHeight     =   495
  52.       ScaleWidth      =   555
  53.       TabIndex        =   2
  54.       Top             =   1740
  55.       Visible         =   0   'False
  56.       Width           =   585
  57.    End
  58.    Begin VB.PictureBox Picture1 
  59.       Appearance      =   0  'Flat
  60.       BackColor       =   &H80000005&
  61.       ForeColor       =   &H80000008&
  62.       Height          =   525
  63.       Index           =   2
  64.       Left            =   4650
  65.       Picture         =   "Network.frx":0442
  66.       ScaleHeight     =   495
  67.       ScaleWidth      =   555
  68.       TabIndex        =   1
  69.       Top             =   1200
  70.       Visible         =   0   'False
  71.       Width           =   585
  72.    End
  73.    Begin VB.PictureBox Picture1 
  74.       Appearance      =   0  'Flat
  75.       BackColor       =   &H80000005&
  76.       ForeColor       =   &H80000008&
  77.       Height          =   525
  78.       Index           =   1
  79.       Left            =   4650
  80.       Picture         =   "Network.frx":0884
  81.       ScaleHeight     =   495
  82.       ScaleWidth      =   540
  83.       TabIndex        =   0
  84.       Top             =   660
  85.       Visible         =   0   'False
  86.       Width           =   570
  87.    End
  88.    Begin AddFlowLib.AddFlow AddFlow1 
  89.       Height          =   3075
  90.       Left            =   450
  91.       TabIndex        =   4
  92.       Top             =   420
  93.       Width           =   4065
  94.       _Version        =   65536
  95.       _ExtentX        =   7170
  96.       _ExtentY        =   5424
  97.       _StockProps     =   101
  98.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  99.          Name            =   "Arial"
  100.          Size            =   8.25
  101.          Charset         =   0
  102.          Weight          =   400
  103.          Underline       =   0   'False
  104.          Italic          =   0   'False
  105.          Strikethrough   =   0   'False
  106.       EndProperty
  107.       BorderStyle     =   1
  108.       ScrollBars      =   3
  109.       Shape           =   0
  110.       LinkStyle       =   0
  111.       Alignment       =   7
  112.       AutoSize        =   0
  113.       ArrowDst        =   3
  114.       ArrowOrg        =   0
  115.       DrawStyle       =   0
  116.       DrawWidth       =   1,4013e-45
  117.       ReadOnly        =   0   'False
  118.       MultiSel        =   -1  'True
  119.       CanDrawNode     =   -1  'True
  120.       CanDrawLink     =   -1  'True
  121.       CanMoveNode     =   -1  'True
  122.       CanSizeNode     =   -1  'True
  123.       CanStretchLink  =   -1  'True
  124.       CanMultiLink    =   -1  'True
  125.       Transparent     =   0   'False
  126.       ShowGrid        =   0   'False
  127.       Hidden          =   0   'False
  128.       Rigid           =   0   'False
  129.       DisplayHandles  =   -1  'True
  130.       AutoScroll      =   -1  'True
  131.       xGrid           =   7,00649e-45
  132.       yGrid           =   7,00649e-45
  133.       xZoom           =   100
  134.       yZoom           =   100
  135.       FillColor       =   16777215
  136.       DrawColor       =   0
  137.       ForeColor       =   0
  138.       BackPicture     =   "Network.frx":0B8E
  139.    End
  140. Attribute VB_Name = "frmNetwork"
  141. Attribute VB_Creatable = False
  142. Attribute VB_Exposed = False
  143. Option Explicit
  144. Private Sub AddFlow1_DblClick()
  145.   frmItemProp.Show 1
  146. End Sub
  147. Private Sub AddFlow1_KeyDown(KeyCode As Integer, Shift As Integer)
  148.   Const KEY_DELETE = &H2E
  149.   If KeyCode = KEY_DELETE Then
  150.     AddFlow1.DeleteSel
  151.   End If
  152. End Sub
  153. Private Sub AddFlow1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  154.   Me.SetFocus
  155. End Sub
  156. Private Sub Form_Activate()
  157.   frmMain.ActivateForm
  158. End Sub
  159. Private Sub Form_Deactivate()
  160.   frmMain.DeactivateForm
  161. End Sub
  162. Private Sub Form_Load()
  163.   frmMain.ShowExample(1).Enabled = False
  164.   Dim nodx As afNode, lnkx As afLink
  165.   With AddFlow1
  166.     .Left = 0
  167.     .Top = 0
  168.     ' Just to accelerate display (Don't forget to reset it at the end)
  169.     .Repaint = False
  170.     .DrawStyle = afInsideSolid
  171.     .DrawColor = &H8000&
  172.     .ArrowDst = 0
  173.     ' Create nodes
  174.     Set nodx = .Nodes.Add(4455, 180, 2685, 2955)
  175.     nodx.ForeColor = 255
  176.     nodx.DrawStyle = afDot
  177.     nodx.DrawColor = 255
  178.     nodx.Alignment = afCenterTOP
  179.     nodx.Transparent = True
  180.     nodx.Text = Chr$(13) + Chr$(10) + "INTERNET"
  181.     Set nodx = .Nodes.Add(240, 150, 3525, 3105)
  182.     nodx.ForeColor = 255
  183.     nodx.DrawColor = 255
  184.     nodx.DrawStyle = afDot
  185.     nodx.Alignment = afCenterTOP
  186.     nodx.Transparent = True
  187.     nodx.Text = Chr$(13) + Chr$(10) + "INTRANET"
  188.         
  189.     Set nodx = .Nodes.Add(540, 1935, 2970, 45) 'LAN
  190.     nodx.Shape = afRectangle
  191.     nodx.FillColor = 0
  192.     Set nodx = .Nodes.Add(3060, 2115, 240, 255) 'Router
  193.     nodx.Shape = afWestTriangle
  194.     nodx.FillColor = 0
  195.     Set nodx = .Nodes.Add(5025, 2100, 240, 240) 'Router
  196.     nodx.Shape = afEastTriangle
  197.     nodx.FillColor = 0
  198.     Set nodx = .Nodes.Add(690, 675, 640, 945) 'Server
  199.     nodx.FillColor = 16777215
  200.     nodx.DrawStyle = afTransparent
  201.     nodx.Alignment = afCenterTOP
  202.     nodx.Shape = afRectangle
  203.     nodx.Transparent = True
  204.     nodx.Text = "Server NT"
  205.     Set nodx.Picture = Picture1(3).Picture
  206.     Set nodx = .Nodes.Add(1710, 1155, 480, 480) 'PC client
  207.     nodx.FillColor = 16777215
  208.     nodx.DrawStyle = afTransparent
  209.     nodx.Shape = 1
  210.     nodx.Transparent = True
  211.     Set nodx.Picture = Picture1(1).Picture
  212.     Set nodx = .Nodes.Add(1245, 2340, 480, 465)
  213.     nodx.FillColor = 16777215
  214.     nodx.DrawStyle = afTransparent
  215.     nodx.Shape = 1
  216.     nodx.Transparent = True
  217.     Set nodx.Picture = Picture1(1).Picture
  218.     Set nodx = .Nodes.Add(2175, 2340, 480, 480)
  219.     nodx.FillColor = 16777215
  220.     nodx.DrawStyle = afTransparent
  221.     nodx.Shape = afRectangle
  222.     nodx.Transparent = True
  223.     Set nodx.Picture = Picture1(2).Picture
  224.     Set nodx = .Nodes.Add(1920, 1905, 60, 60)
  225.     nodx.FillColor = 0
  226.     nodx.Shape = afRectangle
  227.     Set nodx = .Nodes.Add(2385, 1935, 60, 60)
  228.     nodx.FillColor = 0
  229.     nodx.Shape = afRectangle
  230.     Set nodx = .Nodes.Add(1440, 1935, 60, 60)
  231.     nodx.FillColor = 0
  232.     nodx.Shape = afRectangle
  233.     Set nodx = .Nodes.Add(3165, 1950, 60, 60)
  234.     nodx.FillColor = 0
  235.     nodx.Shape = afRectangle
  236.     Set nodx = .Nodes.Add(960, 1905, 60, 60)
  237.     nodx.FillColor = 0
  238.     nodx.Shape = afRectangle
  239.     Set nodx = .Nodes.Add(5790, 750, 480, 375)
  240.     nodx.FillColor = 8454143
  241.     Set nodx = .Nodes.Add(5805, 1995, 480, 390)
  242.     nodx.FillColor = 8454143
  243.     Set nodx = .Nodes.Add(5130, 2475, 435, 455)
  244.     nodx.FillColor = 8454143
  245.     Set nodx = .Nodes.Add(6570, 885, 360, 390)
  246.     nodx.Transparent = True
  247.     nodx.DrawStyle = afTransparent
  248.     nodx.Text = "..."
  249.     Set nodx = .Nodes.Add(6585, 1605, 360, 390)
  250.     nodx.Transparent = True
  251.     nodx.DrawStyle = afTransparent
  252.     nodx.Text = "..."
  253.     Set nodx = .Nodes.Add(4620, 1290, 990, 585)
  254.     nodx.FillColor = 8454143
  255.     nodx.Text = "Internet provider"
  256.     ' Set owners by creating rigid links
  257.     .Rigid = True
  258.     .Hidden = True
  259.     ' The five little black boxes are owned by the "LAN" node
  260.     Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(10))
  261.     lnkx.Selectable = False
  262.     Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(11))
  263.     lnkx.Selectable = False
  264.     Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(12))
  265.     lnkx.Selectable = False
  266.     Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(13))
  267.     lnkx.Selectable = False
  268.     Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(14))
  269.     lnkx.Selectable = False
  270.     ' All other nodes inside the INTRANET node are owned by this node
  271.     Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(3))
  272.     lnkx.Selectable = False
  273.     Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(4))
  274.     lnkx.Selectable = False
  275.     Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(6))
  276.     lnkx.Selectable = False
  277.     Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(7))
  278.     lnkx.Selectable = False
  279.     Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(8))
  280.     lnkx.Selectable = False
  281.     Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(9))
  282.     lnkx.Selectable = False
  283.     ' All nodes inside the INTERNET node are owned by this node
  284.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(20))
  285.     lnkx.Selectable = False
  286.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(19))
  287.     lnkx.Selectable = False
  288.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(18))
  289.     lnkx.Selectable = False
  290.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(17))
  291.     lnkx.Selectable = False
  292.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(16))
  293.     lnkx.Selectable = False
  294.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(15))
  295.     lnkx.Selectable = False
  296.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(5))
  297.     lnkx.Selectable = False
  298.     ' Create true visible links.
  299.     .Hidden = False
  300.     .Rigid = False
  301.     ' - the link between intranet and internet
  302.     Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(4))
  303.     lnkx.DrawWidth = 2
  304.     ' - the other links
  305.     .DrawColor = RGB(0, 255, 0)
  306.     Set lnkx = .Nodes(7).OutLinks.Add(.Nodes(10))
  307.     Set lnkx = .Nodes(9).OutLinks.Add(.Nodes(11))
  308.     Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(12))
  309.     Set lnkx = .Nodes(4).OutLinks.Add(.Nodes(13))
  310.     Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(20))
  311.     Set lnkx = .Nodes(20).OutLinks.Add(.Nodes(15))
  312.     Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(20))
  313.     Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(15))
  314.     Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(17))
  315.     Set lnkx = .Nodes(15).OutLinks.Add(.Nodes(18))
  316.     Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(19))
  317.     Set lnkx = .Nodes(6).OutLinks.Add(.Nodes(14))
  318.     .Repaint = True
  319.   End With
  320. End Sub
  321. Private Sub Form_Resize()
  322.   If WindowState <> 1 And ScaleHeight <> 0 Then
  323.     AddFlow1.Height = ScaleHeight
  324.     AddFlow1.Width = ScaleWidth
  325.   End If
  326. End Sub
  327. Private Sub Form_Unload(Cancel As Integer)
  328.   frmMain.ShowExample(1).Enabled = True
  329. End Sub
  330.